package com.longtengyuyun.dcl;

/**
 * @author ZhaoYunLong
 * @date 2022/4/14
 * @description
 */
public class InStaticDemo {

    private InStaticDemo(){

    }

    public static InStaticDemo getInstance(){
        return InStaticDcl.getInstance();
    }

    /**
     * 类加载  会加锁
     */
    private static class  InStaticDcl{
        private static InStaticDemo instance = new InStaticDemo() ;

        public static InStaticDemo getInstance(){
            return instance;
        }
    }
}



